//用户信息
import { createSlice } from '@reduxjs/toolkit'
const userSlice = createSlice({
    name: 'user',
    initialState: {
        userInfo: {}
    },
    reducers: {
        setUserInfo(state: any, action: any) {
            const { payload = null } = action
            state.userInfo = payload
        },
        resetUserInfo(state: any) {
            state.userInfo = {}
        }
    }
})
export const { setUserInfo,resetUserInfo } = userSlice.actions
export default userSlice.reducer